.class Lcom/waiqin365/h5/util/a;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Lorg/apache/cordova/CordovaArgs;

.field final synthetic b:Lcom/waiqin365/h5/util/WqClosePage;


# direct methods
.method constructor <init>(Lcom/waiqin365/h5/util/WqClosePage;Lorg/apache/cordova/CordovaArgs;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/util/a;->b:Lcom/waiqin365/h5/util/WqClosePage;

    iput-object p2, p0, Lcom/waiqin365/h5/util/a;->a:Lorg/apache/cordova/CordovaArgs;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 3

    const-string/jumbo v0, ""

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/h5/util/a;->a:Lorg/apache/cordova/CordovaArgs;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_1

    :try_start_1
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    move-object v0, v1

    :goto_1
    const-string/jumbo v1, ""

    :try_start_2
    const-string/jumbo v2, "data"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    const-string/jumbo v2, "data"

    invoke-virtual {v0, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
    :try_end_2
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_3

    move-result-object v0

    :goto_2
    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_0

    const-string/jumbo v2, "CORDOVA_ACTIVITY_FINISH"

    invoke-virtual {v1, v2, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/h5/util/a;->b:Lcom/waiqin365/h5/util/WqClosePage;

    invoke-static {v0}, Lcom/waiqin365/h5/util/WqClosePage;->a(Lcom/waiqin365/h5/util/WqClosePage;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v0

    const/4 v2, -0x1

    invoke-virtual {v0, v2, v1}, Lorg/apache/cordova/WqCordovaActivity;->setResult(ILandroid/content/Intent;)V

    iget-object v0, p0, Lcom/waiqin365/h5/util/a;->b:Lcom/waiqin365/h5/util/WqClosePage;

    invoke-static {v0}, Lcom/waiqin365/h5/util/WqClosePage;->a(Lcom/waiqin365/h5/util/WqClosePage;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v0

    const v1, 0x7f040020

    const v2, 0x7f040023

    invoke-virtual {v0, v1, v2}, Lorg/apache/cordova/WqCordovaActivity;->overridePendingTransition(II)V

    iget-object v0, p0, Lcom/waiqin365/h5/util/a;->b:Lcom/waiqin365/h5/util/WqClosePage;

    invoke-static {v0}, Lcom/waiqin365/h5/util/WqClosePage;->a(Lcom/waiqin365/h5/util/WqClosePage;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v0

    invoke-virtual {v0}, Lorg/apache/cordova/WqCordovaActivity;->finish()V

    :cond_1
    return-void

    :catch_0
    move-exception v0

    const-string/jumbo v0, "{\"data\":\"1\"}"

    goto :goto_0

    :catch_1
    move-exception v0

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    :try_start_3
    const-string/jumbo v1, "data"

    const-string/jumbo v2, "1"

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_3
    .catch Lorg/json/JSONException; {:try_start_3 .. :try_end_3} :catch_2

    goto :goto_1

    :catch_2
    move-exception v1

    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_1

    :cond_2
    :try_start_4
    const-string/jumbo v0, ""
    :try_end_4
    .catch Lorg/json/JSONException; {:try_start_4 .. :try_end_4} :catch_3

    goto :goto_2

    :catch_3
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    move-object v0, v1

    goto :goto_2
.end method
